package com.atguigu.gmall.user.controller;

import com.atguigu.gmall.model.user.UserAddress;
import com.atguigu.gmall.model.user.UserInfo;
import com.atguigu.gmall.user.service.UserAddressService;
import com.atguigu.gmall.user.service.UserService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author atguigu-mqx
 */
@RestController
@RequestMapping("/api/user")
public class UserApiController {
    @Autowired
    private UserAddressService userAddressService;

    @Autowired
    private UserService userService;

    @GetMapping("inner/findUserAddressListByUserId/{userId}")
    public List<UserAddress> findUserAddressListByUserId(@PathVariable String userId){
        return userAddressService.findUserAddressListByUserId(userId);
    }

    @ApiOperation("获取用户信息")
    @GetMapping("inner/getUserInfo/{userId}")
    public UserInfo getUserInfo(@PathVariable("userId") String userId){
        return userService.getUserInfo(userId);
    }
}
